<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/6/27
 * Time: 13:35
 */

namespace common\components\behaviors;


use doumiaoduo\ueditor\UploaderHelper;
use yii\base\Behavior;

class FtpSynchronousBehavior extends Behavior{
    public function events()
    {
        return [
            UploaderHelper::UPLOAD_SUCCESS => 'synchronousTransmission',
        ];
    }

    public  function synchronousTransmission($event){
        \Yii::$app->ftp->upload('.'.$event->filePath,$event->filePath);
    }

}